<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>完善资料</title>

    <link rel="stylesheet" href="__STATIC__/index/assets/sui/dist/css/sm.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2008579_wi32sytndy.css">
    <link rel="stylesheet" href="__STATIC__/index/assets/css/index.css">
    <link rel="stylesheet" href="__STATIC__/index/assets/sui/dist/css/sm-extend.min.css">


</head>

<body>
<!-- page 容器 -->
<div class="page">
    <!-- 工具栏 -->
    <div class="content">
        <header class="bar bar-nav">
            <a onclick="javascript:window.history.go(-1);" class="icon icon-left pull-left"></a>
            <h1 class="title">完善资料</h1>
        </header>
        <div class="list-block user_msg_cont">
            <form action="" method="post">
            <ul class="user_save">
                <!-- Text inputs -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">姓名</div>
                            <div class="item-input">
                                <input type="text" value="{$user.user_name}" name="user_name" placeholder="请填写真实姓名">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">电话</div>
                            <div class="item-input">
                                <input type="number" value="{$user.user_phone}" name="user_phone" placeholder="请填写真实电话">
                            </div>
                        </div>
                    </div>
                </li>
                <!-- Date -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">楼号</div>
                            <div class="item-input">
                                <input type="text" value="{$user.user_address}" name="user_address" id="adderss" value="" placeholder="请选择楼号">
                            </div>
                        </div>
                    </div>
                </li>
                <div class="list-block inset">
                    <li><a type="submit" onclick="save()" class="list-button button button-big button-fill button-info ">保存资料</a></li>
                </div>
            </ul>
            </form>
        </div>
    </div>

</div>
</body>
<script src='http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js'></script>
<script src='__STATIC__/index/assets/sui/dist/js/sm.js'></script>
<script type='text/javascript' src='__STATIC__/index/assets/sui/dist/js/sm-extend.js' charset='utf-8'></script>
<script>
$(function () {
    $("#adderss").picker({
        toolbarTemplate: '<header class="bar bar-nav">\
      <button class="button button-link pull-right close-picker">确定</button>\
      <h1 class="title">请选择楼号</h1>\
      </header>',
        cols: [
            {
                textAlign: 'center',
                values: ['1号楼', '2号楼', '3号楼', '4号楼', '5号楼', '6号楼', '7号楼', '8号楼','9号楼','10号楼','11号楼','12号楼'],
                //如果你希望显示文案和实际值不同，可以在这里加一个displayValues: [.....]
            },
            {
                textAlign: 'center',
                values: ['1层', '2层', '3层', '4层','5层'],
            },
            {
                textAlign: 'center',
                values: [1,2,3,4,5],
            },
            {
                textAlign: 'center',
                values: [0,1,2,3],
            },
            {
                textAlign: 'center',
                values: [0,1,2,3,4,5,6,7,8,9],
            }
        ]
    });
})
function save() {
    var username=$('input[name="user_name"]').val();
    var userphone=$('input[name="user_phone"]').val();
    var useraddress=$('input[name="user_address"]').val();
    if(!username || !userphone || !useraddress){
        $.toast('完善所有信息才可提交呀', 1000);
    }
    $.ajax({
        url: "{:url('saveUserMsg')}",
        type: "POST",
        data: {
            user_name:username,
            user_phone:userphone,
            user_address:useraddress
        },
        dataType: "json",
        success: function(res){
           if(res.status){
               $.toast('资料完善成功，点击左上角返回吧', 1500);
           }else{
               $.toast(res.msg, 1500);
           }
        }
    });
}
</script>
</html>